import fetch from 'utils/fetch';
/**
 * 会员管理
 */
// 新会员收费项
export function listMembershipItem() {
    return fetch({
        url: '/vip/listMembershipItem',
        method: 'post'
    });
}


// 服务收费设置:查看页
export function membershipServiceDetail(serviceType) {
    const data = {
        serviceType
    };
    return fetch({
        url: `/vip/membershipServiceDetail/${serviceType}`,
        method: 'post',
        data
    });
}

// 服务收费设置:会员服务编辑页更新操作
export function updateVipPrice(pId, sRemark, sWrongCount, sStudyCount, sSituationCount, sBasePrice, sMarketPrice, sDiscount, sIsHardwareDiscount, sHardwareDiscount, sHardwareFrom, sHardwareTo) {
    const data = {
        pId,
        sRemark,
        sWrongCount,
        sStudyCount,
        sSituationCount,
        sBasePrice,
        sMarketPrice,
        sDiscount,
        sIsHardwareDiscount,
        sHardwareDiscount,
        sHardwareFrom,
        sHardwareTo
    };
    return fetch({
        url: '/vip/updateVipPrice',
        method: 'post',
        data
    });
}

// 服务收费设置:硬件服务（空中课堂，e直播，报平安，家校通）编辑页更新操作
export function updateHardwarePrice(pId, sRemark, sBasePrice, sMarketPrice, sIsDiscount, sDiscount) {
    const data = {
        pId,
        sRemark,
        sBasePrice,
        sMarketPrice,
        sIsDiscount,
        sDiscount
    };
    return fetch({
        url: '/vip/updateHardwarePrice',
        method: 'post',
        data
    });
}

// 服务收费设置:编辑记录
export function pageMembershipServiceLog(serviceType, page, rows) {
    const data = {
        serviceType,
        page,
        rows
    };
    return fetch({
        url: `/vip/pageMembershipServiceLog/${serviceType}/${page}/${rows}`,
        method: 'post',
        data
    });
}
// 获取官方活动分页列表
export function findActivityByPage(page, rows, provinceId, cityId, areaId, title, status, creatorId) {
    const data = {
        provinceId,
        cityId,
        areaId,
        title,
        status,
        creatorId
    };
    return fetch({
        // /activity/query/{page}/{rows}
        url: '/activity/query/'+page+'/'+rows,
        method: 'post',
        data
    });
}
